# 元组
# 定义一个tuple
# 变量名 = (元素1,元素2,......)
# 特点："不可变"（定义的时候是什么样，那就是什么样子），有序，元素可以重复，元素的类型可以不唯一
# "不可变"：指的是元素的指向不变
tuple1 = (1, 2, 3, 4, 5, "abc")
print(tuple1, type(tuple1))
# 定义一个空元组
tuple2 = ()
print(tuple2, type(tuple2))
# 定义一个只有一个元素元组 记得加上逗号
tuple3 = (1,)
print(tuple3, type(tuple3))

tuple4 = (5, 5, 5, 5, 6, 7, 8, 9)
print(tuple4.index(6))
print(tuple4.count(5))
# tuple4[1] = 500 元组不支持修改
print(tuple4[1])

list1 = [1, 2, 3]
tuple5 = (1, 2, 3, list1)
print(tuple5, type(tuple5))
tuple5[3][1] = 200
print(tuple5)